package com.fyt.ZhongYaoApp.mapper;

import com.fyt.ZhongYaoApp.pojo.Hospital;
import com.fyt.ZhongYaoApp.pojo.pg.HospitalPG;
import com.fyt.ZhongYaoApp.pojo.vo.HospitalVO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface HospitalMapper {

    @Select("select h_name from hospital where id = #{id}")
    String getNameById(Hospital hospital);

    @Insert("insert into hospital(h_name,h_mess,create_time,update_time)" +
            "values (#{hName},#{hMess},now(),now())")
    void add(Hospital hospital);


    @Select("select * from hospital where 1=1")
    List<Hospital> hospitalList();

    @Select("select * from hospital where h_name like '%${hName}%'")
    List<HospitalVO> querryHopital(HospitalPG hospitalPG);

    @Select("select * from hospital where id = #{id}")
    Hospital querryHopitalById(Hospital hospital);
}
